package com.example.tests;

import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

public class Untitled extends SeleneseTestCase {
	public void setUp() throws Exception {
		setUp("http://change-this-to-the-site-you-are-testing/", "*chrome");
	}
	public void testUntitled() throws Exception {
		selenium.open("/livrocaixa/Index.jsp");
		selenium.click("link=CADASTRE-SE");
		selenium.waitForPageToLoad("30000");
		selenium.type("login", "joze");
		selenium.type("name", "Jose");
		selenium.type("password", "12345");
		selenium.type("password02", "12345");
		selenium.click("genero");
		selenium.click("//input[@value='cadastrar']");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.getText("//body/div").matches("^exact:Login Senha CADASTRE-SE Olá! Quem é você[\\s\\S]$"));
		selenium.type("login", "joze");
		selenium.type("password", "12345");
		selenium.click("//input[@value='Login']");
		selenium.waitForPageToLoad("30000");
		selenium.type("account", "1591-1");
		selenium.type("agency", "1591-1");
		selenium.type("account", "");
		selenium.type("account", "11405-2");
		selenium.click("//input[@value='adicionar']");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isTextPresent("Missing Argument"));
		selenium.type("label", "Banco do Brasil");
		selenium.type("account", "11405-2");
		selenium.click("//input[@value='adicionar']");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isTextPresent("Missing Argument"));
		selenium.type("label", "Banco do Brasil");
		selenium.type("agency", "1591-1");
		selenium.click("//input[@value='adicionar']");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isTextPresent("Missing Argument"));
		selenium.type("label", "Banco do Brasil");
		selenium.type("account", "11405-2");
		selenium.type("agency", "1591-1");
		selenium.click("//input[@value='adicionar']");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isTextPresent("Banco do Brasil	Exibir : 		Remover :"));
		verifyTrue(selenium.isTextPresent("Conta criada"));
		selenium.type("label", "Banco do Brasil");
		selenium.type("account", "11405-2");
		selenium.type("agency", "1591-1");
		selenium.click("//input[@value='adicionar']");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isTextPresent("Account Already Exists"));
		selenium.click("//input[@value='logoff']");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isTextPresent("Olá! Quem é você?"));
	}
}
